{include file="common/header.tpl"}
<section class="main">
	<nav class="left-col">{include file="common/navi-education.tpl"}</nav>
    <article class="right-col">
    	<h2><a href="{$smarty.const.HOST_BACKEND}education">{$arrSmarty.category[$smarty.get.type]}</a> &raquo; Thêm mới</h2>
        <form name="frmAdd" id="frmAdd" method="post" enctype="multipart/form-data" action="{$smarty.const.HOST_BACKEND}education/save" class="ui">
        	<input type="hidden" name="pparentid" id="pparentid" value="{if isset($row)}{$row.educateid}{else}0{/if}" />
           	<input type="hidden" name="ptbfeature" id="ptbfeature" />
            <input type="hidden" name="pcontent" id="pcontent" />
            <input type="hidden" name="pfulladdr" id="pfulladdr" />
            <input type="hidden" name="ptype" id="ptype" value="{$smarty.get.type}" />
        	<ul>
                {if isset($smarty.session.EDUCATION_ERROR)}
                    <li class="error">
                    	{include file="common/error.tpl" dataSession=$smarty.session.EDUCATION_ERROR}                        
                    </li>
                {/if} 
                {if $arrAlbum}
                    <li>
                        <label for="palbumid">Album sideshow:</label>
                        <div class="sel">
                            <select id="palbumid" name="palbumid">
                                <option value="0">--Chọn--</option>
                                {foreach item=item from=$arrAlbum}
                                    <option value="{$item.albumid}" {if isset($smarty.session.EDUCATION_POST.palbumid) && $smarty.session.EDUCATION_POST.palbumid==$item.albumid}selected="selected"{/if}>{$item.name} ({$item.timage} hình)</option>
                                {/foreach}
                            </select>
                        </div>
                    </li>
                {/if}                             
                <li>
                    <label for="pcategoryid">Đào tạo <span class="required">*</span>:</label>
                    <div class="sel">
                        <select id="pcategoryid" name="pcategoryid" onchange="javascript:loadSub(this.value,'psubid');">
                            <option value="0">---Chọn--</option>
                            {foreach item=item from=$arrCategory}
                            	<option value="{$item.categoryid}" {if isset($smarty.session.EDUCATION_POST.pcategoryid) && $smarty.session.EDUCATION_POST.pcategoryid==$item.categoryid}selected="selected"{elseif $row.categoryid==$item.categoryid}selected="selected"{/if}>{$item.name}</option>
                            {/foreach}
                        </select>
                	</div>
                </li>
                <li>
                    <label for="psubid">Phân cấp:</label>
                    <div class="sel">
                        <select id="psubid" name="psubid">
                            <option value="0">---Chọn--</option>
                            {foreach item=item from=$arrSub}
                            	<option value="{$item.categoryid}" {if isset($smarty.session.EDUCATION_POST.pcategoryid) && $smarty.session.EDUCATION_POST.psubid==$item.categoryid}selected="selected"{elseif $row.categoryid==$item.categoryid}selected="selected"{/if}>{$item.name}</option>
                            {/foreach}
                        </select>
                    </div>
                </li>                                           	                
                {if $arrSpec}
                    <li>
                        <label>Chuyên ngành:</label>
                        <div class="chk">                                        
                            <ul>
                                {foreach item=item from=$arrSpec}
                                    <li>
                                        <input type="checkbox" name="pspec[]" id="pspec{$item.categoryid}" value="{$item.categoryid}" class="chk" />
                                        <label class="chk" for="pspec{$item.categoryid}">{$item.name}</label>
                                    </li>
                                {/foreach}
                            </ul>     
                        </div>                       
                    </li>
                {/if}                        
                <li>
                    <label for="pname">Tên trường <span class="required">*</span>:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="pname" id="pname" value="{if isset($smarty.session.EDUCATION_POST.pname)}{$smarty.session.EDUCATION_POST.pname}{/if}" maxlength="{$smarty.const.VL_NAME_MAXLENGTH}" />
                    </div>
                </li>
                <li>
                    <label for="pprovince">Tỉnh/thành <span class="required">*</span>:</label>
                    <div class="sel">
                        <select id="pprovince" name="pprovince" onchange="javascript:loadDistrict(this.value,'pdistrict');">
                            <option value="0">---Chọn--</option>
                            {if isset($smarty.session.EDUCATION_POST.pprovince)}
                                {html_options options=$arrProvince selected=$smarty.session.EDUCATION_POST.pprovince}
                            {else}
                                {html_options options=$arrProvince selected=$intProvince}
                            {/if}
                        </select>
                    </div>
                </li>
                <li>
                    <label for="pdistrict">Quận/huyện <span class="required">*</span>:</label>
                    <div class="sel">
                        <select id="pdistrict" name="pdistrict">
                            <option value="0">---Chọn--</option>
                            {if isset($smarty.session.EDUCATION_POST.pdistrict)}
                                {html_options options=$arrDistrict selected=$smarty.session.EDUCATION_POST.pdistrict}
                            {else}
                                {html_options options=$arrDistrict selected=$intDistrict}
                            {/if}
                        </select>
                    </div>
                </li>  
                <li>
                    <label for="paddr">Địa chỉ <span class="required">*</span>:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="paddr" id="paddr" value="{if isset($smarty.session.EDUCATION_POST.paddr)}{$smarty.session.EDUCATION_POST.paddr|escape}{/if}"/>
                    </div>
                </li> 
                <li>
                    <label for="platitude">Vĩ độ <span class="required">*</span>:</label>
                    <div class="txt">
                    	<input type="text" class="text" id="platitude" name="platitude" value="{if isset($smarty.session.EDUCATION_POST.platitude)}{$smarty.session.EDUCATION_POST.platitude|escape}{/if}"/>
                    </div>
                </li>
                <li>
                    <label for="plongitude">Kinh độ <span class="required">*</span>:</label>
                    <div class="txt">
                    	<input type="text" class="text" id="plongitude" name="plongitude" value="{if isset($smarty.session.EDUCATION_POST.plongitude)}{$smarty.session.EDUCATION_POST.plongitude|escape}{/if}"/>
                    </div>
                </li>                      
                {if $intParentId == 0} 
                    <li>
                        <label for="plink">Link website:</label>
                        <div class="txt">
                        	<input type="text" class="text" name="plink" id="plink" value="{if isset($smarty.session.EDUCATION_POST.plink)}{$smarty.session.EDUCATION_POST.plink|escape}{/if}" maxlength="255"/>                                    
                        </div>
                    </li> 
                {/if}
                <li>
                    <label for="ptel">Điện thoại:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="ptel" id="ptel" value="{if isset($smarty.session.EDUCATION_POST.ptel)}{$smarty.session.EDUCATION_POST.ptel|escape}{/if}"/>
                    </div>
                </li>
                <li>
                    <label for="pfax">Fax:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="pfax" id="pfax" value="{if isset($smarty.session.EDUCATION_POST.pfax)}{$smarty.session.EDUCATION_POST.pfax|escape}{/if}"/>
                    </div>
                </li>
                <li>
                    <label for="pemail">Email:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="pemail" id="pemail" value="{if isset($smarty.session.EDUCATION_POST.pemail)}{$smarty.session.EDUCATION_POST.pemail|escape}{/if}"/>
                    </div>
                </li>
                {if $intParentId == 0} 
                    <li>
                        <label for="pimage">Logo:</label>
                        <div class="txt">
                        	<input type="file" class="text" name="pimage" id="pimage" value="" />
                        </div>
                    </li>
                    <li>
                        <label for="pshort">Sơ lược</label>
                        <div class="area">
                        	<textarea cols="1" rows="1" name="pshort" id="pshort">{$smarty.session.EDUCATION_POST.pshort}</textarea>
                        </div>
                    </li>                            
                    <li>
                        <label for="pcontent">Giới thiệu:</label>
                        <div class="area">
                        	<textarea cols="1" rows="1" name="fckcontent" id="fckcontent">{$smarty.session.EDUCATION_POST.pcontent}</textarea>
                        </div>
                    </li>                                 
                {/if}                
                {if $intParentId == 0} 
                    <li>
                        <label>Thông tin mở rộng</label>                                                    
                        {include file="common/table-feature.tpl"}
                    </li>
                {/if} 
                <li>
                    <label for="ptag">Tag:</label>
                    <div class="txt">
                    	<input type="text" class="text" name="ptag" id="ptag" value="{if isset($smarty.session.EDUCATION_POST.ptag)}{$smarty.session.EDUCATION_POST.ptag}{/if}" maxlength="100" />
                    </div>
                </li>
                <li>
                    <button type="submit"><strong>Lưu dữ liệu</strong></button>
                    <button type="reset"><strong>Nhập lại</strong></button>
                </li>
            </ul>
        </form>
    </article>
<section>
{include file="common/footer.tpl"}
                
